Imports ClubStarterKit.Web

Partial Class Statistics_NewTeam
    Inherits System.Web.UI.Page

    Protected Sub AddTeam_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddTeam.Click
        'ClubStarterKit.Web.League.AddTeam(Request("seasonid"), NameTXT.Text, Coach.SelectedValue)

        Using db As New CricketBLL.CricketStatsDataContext(Settings.DatabaseConnectionString())

            Dim team As New CricketBLL.Team
            team.TeamName = NameTXT.Text

            db.Teams.InsertOnSubmit(team)
            db.SubmitChanges()

        End Using

        'Response.Write("<script>window.parent.hidePopWin();</script>")
        Response.Redirect("Default.aspx")
    End Sub
End Class
